#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=60;
typedef int LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
char str[maxn];
LL dp[maxn][2];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL t;cin>>t;
  while(t--){
    LL n,k;cin>>n>>k;
    for(LL i=1;i<=n;i++) cin>>str[i];
    memset(dp,0x3f,sizeof(dp));
    LL num=0;
    for(LL i=1;i<=n;i++){
        if(str[i]=='*') num++;
    }
    if(num==1){
        cout<<"1"<<"\n";continue;
    }
    else{
        for(LL i=1;i<=n;i++){
            if(str[i]=='*'){
                dp[i][1]=1;break;
            }
        }/*
        for(LL i=n;i>=1;i--){
            if(str[i]=='*'){
                dp[i][1]=1;break;
            }
        }*/
        for(LL i=1;i<=n;i++){
            if(str[i]=='*'){
                for(LL j=max(i-k,1);j<=i-1;j++){
                    dp[i][0]=min(dp[i][0],dp[j][1]);
                }
                for(LL j=max(i-k,1);j<=i-1;j++){
                    dp[i][1]=min(dp[i][1],dp[j][0]+1);
                }
            }
            else if(str[i]=='.'){
                for(LL j=max(i-k,1);j<=i-1;j++){
                    dp[i][0]=min(dp[i][0],dp[j][1]);
                }
            }
        }
        LL ans=0;
        for(LL i=n;i>=1;i--){
            if(str[i]=='*'){
                ans=min(dp[i][0],dp[i][1]);
                break;
            }
        }
        cout<<ans<<"\n";
    }
  }
return 0;
}
